package com.woniu.internalcommon.remote;

import com.woniu.internalcommon.dto.ForecastPriceDTO;
import com.woniu.internalcommon.dto.POIType;
import com.woniu.internalcommon.dto.ResponseResult;
import com.woniu.internalcommon.request.PointRequest;
import com.woniu.internalcommon.response.DirectionResponse;
import com.woniu.internalcommon.response.TerminalResponse;
import com.woniu.internalcommon.response.TraSearchResponse;
import com.woniu.internalcommon.response.TrackResponse;
import com.woniu.internalcommon.request.POIRequestDTO;
import com.woniu.internalcommon.response.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "service-map" , path = "service-map")
public interface ServiceMapClient {
    /**
     * 获取预估距离和时长
     *
     * @param forecastPriceDTO
     * @return
     */

    @PostMapping("/driving/direction")
    ResponseResult<DirectionResponse> direction(@RequestBody ForecastPriceDTO forecastPriceDTO);

    /**
     * 上传终端
     *
     * @param name 车牌号
     * @param desc carid
     * @return
     */
    @GetMapping("/terminal/add")
    ResponseResult<TerminalResponse> addTerminal(@RequestParam("name") String name,
                                                 @RequestParam("desc") String desc);

    /**
     * 添加轨迹
     *
     * @param tid
     * @param trname
     * @return
     */
    @GetMapping("/track/add")
    ResponseResult<TrackResponse> addTrack(@RequestParam("tid") String tid
            , @RequestParam("trname") String trname);

    /**
     * 半径终端搜索
     *
     * @param center 纬度,经度
     * @param radius 半径
     * @return
     */

    @GetMapping("/terminal/aroundSearch")
    ResponseResult<List<TerminalResponse>> terminalAroundSearch(@RequestParam("center") String center,


                                                                @RequestParam("radius") Integer radius);

    /**
     * 上传轨迹信息
     *
     * @param pointRequest
     * @return
     */
    @PostMapping("/upload")
    ResponseResult<String> uploadTrack(@RequestBody PointRequest pointRequest);


    /**
     * 根据时间获取行程
     *
     * @param tid       终端id
     * @param startTime 上车时间
     * @param endTime   下车时间
     * @return 用了多长时间，跑了多少米
     */


    @GetMapping("/track/trasearch")
    ResponseResult<TraSearchResponse> traSearch(@RequestParam("tid") String tid,
                                                @RequestParam("startTime") Long startTime,
                                                @RequestParam("endTime") Long endTime);

    /**
     * poi周边搜索
     *
     * @param poiRequestDTO 纬度,经度 搜索半径 服务类型
     * @return 商家
     */
    @PostMapping("poi/around")
    ResponseResult<List<POIResponse>> aroundPOISearch(@RequestBody POIRequestDTO poiRequestDTO);

    /**
     * 当前天气查询
     * city code
     */
    @GetMapping("weather/live")
    ResponseResult<List<WeatherLiveResponse>> getLiveWeather(@RequestParam("city") String city);

    /**
     * 预报天气
     *
     * @param city 城市编码
     * @return
     */
    @GetMapping("weather/for")
    ResponseResult<List<WeatherForResponse>> getForWeather(@RequestParam("city") String city);

    @GetMapping("pointType/getAllPOITypeNames")
    public ResponseResult<List<String>> getAllPOITypeNames();
}